<template>
  <div class="app-container">
    <Find :OriginalFilter="{ static: true }" :formList="formList" @findClicked="findClicked" />

    <div class="flex mt10" style="width: 100%; background-color: white">
      <el-card shadow="never" :body-style="{ padding: '5px 10px 5px' }">
        <h1 class="f16">员工资料明细</h1>
        <Table :tableHeader="tableHeader" :tableData="tableData" selection class="mt10" :isLoading="isLoading" />
      </el-card>
    </div>
    <el-card shadow="never" :body-style="{ padding: '5px' }">
      <PageModule :PageData="{ total, buttonS: true }" @pageSizeChange="handleSizeChange" @pageChange="handleCurrentChange" />
    </el-card>

    <!-- 员工变更查询 -->
    <el-drawer v-model="changeDialog" :direction="'ttb'" size="small" :with-header="false">
      <span @click="changeDialog = false" style="float: right; cursor: pointer; color: rgb(7, 7, 7)">X</span>
      <div class="flex AIC" style="flex-direction: column">
        <Find :OriginalFilter="{ static: true }" :formList="formList2" @findClicked="findClicked2" :searchImg="false" />
        <div class="flex mt10 JCC" style="width: 100%; background-color: white">
          <el-card shadow="never" :body-style="{ padding: '5px 10px 5px' }">
            <h1 class="f16">员工变更查询</h1>
            <Table :tableHeader="tableHeader2" :tableData="tableData2" class="mt10" :outTableHeight="150" />
            <PageModule :PageData="{ total: total2, buttonS: true }" @pageSizeChange="handleSizeChange2" @pageChange="handleCurrentChange2" />
          </el-card>
        </div>
      </div>
    </el-drawer>
  </div>
</template>
<script lang="ts">
import { defineComponent } from 'vue'
import SynchronizationLoginWork from '@/utils/SynchronizationLoginWork'
import fileRequest from '@/utils/fileRequest'
import JMessage from '@/utils/JMessage'
export default defineComponent({
  name: 'EmployeeInformationInquiryJ'
})
</script>
<script lang="ts" setup>
import { i18n, Jzhcn } from '@/i18n'
import { ref } from 'vue'
import { ElMessage } from 'element-plus'
import service from '@/utils/request'
import { debounce } from 'lodash'
import { onMounted, watch } from 'vue'
const defaultProps = {
  value: 'deptNo',
  children: 'childDepartment',
  label: 'deptName'
}
const treeData = ref([]) as any
const getTreeData = async () => {
  const res = await SynchronizationLoginWork.get('/dept/GetAllData')
  treeData.value = res.data
}
const workOption = ref([]) as any
const workTypeOption = ref([]) as any
// 获取职务下拉框
const getWorkOptions = async () => {
  const res = await SynchronizationLoginWork.get('/Employee/getDutiesList')
  workOption.value = res.data.map((item: any) => {
    return {
      optionKey: item.positionSeq,
      optionValue: item.position,
      optionLabel: item.position
    }
  })
}
// 获取工种下拉框
const getWorkTypeOptions = async () => {
  const res = (await SynchronizationLoginWork.post('/Employee/getWorkTypeList', {
    pageNum: 1,
    pageSize: 9999,
    workType: ''
  })) as any
  workTypeOption.value = res.data.list.map((item: any) => {
    return {
      optionKey: item.workTypeSeq,
      optionValue: item.workType,
      LeftLabel: item.workType,
      RightLabel: item.workTypeSeq
    }
  })
}
onMounted(() => {
  getTreeData()
  getWorkOptions()
  getWorkTypeOptions()
})
const formList = ref([
  {
    type: 'button',
    checkboxLabel: '花名册导出'
  },
  {
    type: 'tree',
    treeValue: '',
    treeLabel: '部门',
    defaultProps: defaultProps,
    treeData: treeData
  },
  {
    type: 'input',
    inputPlaceholder: '请输入姓名',
    inputValue: ''
  },
  {
    type: 'input',
    inputPlaceholder: '请输入身份证号',
    inputValue: ''
  },
  {
    type: 'select',
    selectValue: '',
    selectLabel: '',
    selectP: '职务',
    selectOptions: workOption
  },
  {
    type: 'select',
    selectValue: '',
    selectP: '工种',
    selectOptions: workTypeOption
  },
  {
    type: 'select',
    selectValue: '',
    selectLabel: '',
    selectP: '计件/计时',
    selectOptions: [
      {
        optionKey: '1',
        optionValue: '计件',
        optionLabel: '计件'
      },
      {
        optionKey: '2',
        optionValue: '计时',
        optionLabel: '计时'
      }
    ]
  },
  {
    type: 'select',
    selectValue: '',
    selectLabel: '',
    selectP: '性别',
    selectOptions: [
      {
        optionKey: '1',
        optionValue: '男',
        optionLabel: '男'
      },
      {
        optionKey: '2',
        optionValue: '女',
        optionLabel: '女'
      }
    ]
  },
  {
    type: 'dateSingle',
    dateLabel: '进厂日期开始',
    dateValue: ''
  },
  {
    type: 'dateSingle',
    dateLabel: '进厂日期结束',
    dateValue: ''
  },
  {
    type: 'dateSingle',
    dateLabel: '离职日期开始',
    dateValue: ''
  },
  {
    type: 'dateSingle',
    dateLabel: '离职日期结束',
    dateValue: ''
  },
  {
    type: 'dateSingle',
    dateLabel: '出生日期开始',
    dateValue: ''
  },
  {
    type: 'dateSingle',
    dateLabel: '出生日期结束',
    dateValue: ''
  },
  {
    type: 'input',
    inputPlaceholder: '请输入开户名',
    inputValue: ''
  },
  {
    type: 'input',
    inputPlaceholder: '请输入开户行',
    inputValue: ''
  },
  {
    type: 'input',
    inputPlaceholder: '请输入银行卡号',
    inputValue: ''
  },
  {
    type: 'input',
    inputPlaceholder: '请输入地址',
    inputValue: ''
  },
  {
    type: 'select',
    selectValue: '',
    selectP: '签订合同',
    selectLabel: '',
    selectOptions: [
      {
        optionKey: '1',
        optionValue: '已签',
        optionLabel: '已签'
      },
      {
        optionKey: '2',
        optionValue: '未签',
        optionLabel: '未签'
      }
    ]
  },
  {
    type: 'checkbox',
    checkboxLabel: '在职',
    checked: true
  },
  {
    type: 'checkbox',
    checkboxLabel: '离职',
    checked: true
  },
  {
    type: 'input',
    inputPlaceholder: '请输入工号',
    inputValue: ''
  },
  {
    type: 'button',
    checkboxLabel: '置空',
    bgColor: '#1890FF'
  },
  {
    type: 'button',
    checkboxLabel: '员工变更查询'
  }
])
const tableHeader = ref([
  {
    label: '部门名称',
    prop: 'deptName'
  },
  {
    label: '工号',
    prop: 'workerId'
  },
  {
    label: '姓名',
    prop: 'name',
    width: '55'
  },
  {
    label: '性别',
    prop: 'sex',
    width: '55'
  },
  {
    width: '150',
    label: '身份证号',
    prop: 'idNo'
  },
  {
    label: '出生日期',
    prop: 'brisday'
  },
  {
    label: '职务',
    prop: 'position'
  },
  {
    label: '工种',
    prop: 'workType'
  },
  {
    label: '计时/计件',
    prop: 'calcType'
  },
  {
    label: '电话号码',
    prop: 'mobileNo'
  },
  {
    width: '350',
    label: '原地址',
    prop: 'address'
  },
  {
    label: '进厂日期',
    prop: 'dateIn'
  },
  {
    label: '离职日期',
    prop: 'delDate'
  },
  {
    label: '离职类型',
    prop: 'delReason'
  },
  {
    label: '卡号用户',
    prop: 'bankCardUser'
  },
  {
    label: '开户行',
    prop: 'bankCardName'
  },
  {
    width: '150',
    label: '银行卡号',
    prop: 'bankCardId'
  },
  {
    label: '合同签订',
    prop: 'contract'
  },
  {
    label: '学历',
    prop: 'education'
  },
  {
    label: '民族',
    prop: 'nation'
  },
  {
    label: '婚否',
    prop: 'married'
  },
  {
    label: '紧急联络人',
    prop: 'contactPerson'
  },
  {
    label: '紧急联络电话',
    prop: 'contactPhone'
  },
  {
    label: '现地址',
    prop: 'addressNow'
  },
  {
    width: '50',
    label: '成年',
    prop: 'childFlag'
  },
  {
    label: '状态',
    prop: 'status'
  }
])
const cfmFlag = () => {
  const Unaudited = formList.value.find((item: any) => item.type === 'checkbox' && i18n.global.t(item.checkboxLabel) === '在职')
  const Audited = formList.value.find((item: any) => item.type === 'checkbox' && i18n.global.t(item.checkboxLabel) === '离职')
  if (!Unaudited || !Audited) return
  if (Unaudited.checked && Audited.checked) {
    return null
  } else if (Unaudited.checked) {
    return '1'
  } else if (Audited.checked) {
    return '2'
  } else {
    ElMessage('必须至少选择一项')
    Unaudited.checked = true
    Audited.checked = true
    return null
  }
}
// 表一模块
const findClicked = async (content: string) => {
  if (content === '置空') {
    formList.value.forEach((item: any) => {
      item.treeValue = ''
      item.inputValue = ''
      item.selectValue = ''
      item.dateValue = ''
    })
  }
  if (content === '员工变更查询') {
    changeDialog.value = true
    getTableList2()
  }
  if (content === '花名册导出') {
    getDeptName(
      formList.value.find((item: any) => item.treeLabel && Jzhcn.Find[item.treeLabel.split('.')[1] as keyof typeof Jzhcn.Find] === '部门')?.treeValue
    )
    const res = (await fileRequest.post(`/Employee/exportPcEmployee`, {
      address: formList.value.find(
        (item: any) => item.inputPlaceholder && Jzhcn.Find[item.inputPlaceholder.split('.')[1] as keyof typeof Jzhcn.Find] === '请输入地址'
      )?.inputValue,
      bankCardId: formList.value.find(
        (item: any) => item.inputPlaceholder && Jzhcn.Find[item.inputPlaceholder.split('.')[1] as keyof typeof Jzhcn.Find] === '请输入银行卡号'
      )?.inputValue,
      bankCardName: formList.value.find(
        (item: any) => item.inputPlaceholder && Jzhcn.Find[item.inputPlaceholder.split('.')[1] as keyof typeof Jzhcn.Find] === '请输入开户行'
      )?.inputValue,
      bankCardUser: formList.value.find(
        (item: any) => item.inputPlaceholder && Jzhcn.Find[item.inputPlaceholder.split('.')[1] as keyof typeof Jzhcn.Find] === '请输入开户名'
      )?.inputValue,
      calcType: formList.value.find((item: any) => item.selectP && Jzhcn.Find[item.selectP.split('.')[1] as keyof typeof Jzhcn.Find] === '计件/计时')
        ?.selectValue,
      contract: formList.value.find((item: any) => item.selectP && Jzhcn.Find[item.selectP.split('.')[1] as keyof typeof Jzhcn.Find] === '签订合同')
        ?.selectValue,
      deptName: arr,
      idNo: formList.value.find(
        (item: any) => item.inputPlaceholder && Jzhcn.Find[item.inputPlaceholder.split('.')[1] as keyof typeof Jzhcn.Find] === '请输入身份证号'
      )?.inputValue,
      inBirthday: formList.value.find(
        (item: any) => item.dateLabel && Jzhcn.Find[item.dateLabel.split('.')[1] as keyof typeof Jzhcn.Find] === '出生日期开始'
      )?.dateValue,
      inLeaveTime: formList.value.find(
        (item: any) => item.dateLabel && Jzhcn.Find[item.dateLabel.split('.')[1] as keyof typeof Jzhcn.Find] === '离职日期开始'
      )?.dateValue,
      inTime: formList.value.find(
        (item: any) => item.dateLabel && Jzhcn.Find[item.dateLabel.split('.')[1] as keyof typeof Jzhcn.Find] === '进厂日期开始'
      )?.dateValue,
      name: formList.value.find(
        (item: any) => item.inputPlaceholder && Jzhcn.Find[item.inputPlaceholder.split('.')[1] as keyof typeof Jzhcn.Find] === '请输入姓名'
      )?.inputValue,
      outBirthday: formList.value.find(
        (item: any) => item.dateLabel && Jzhcn.Find[item.dateLabel.split('.')[1] as keyof typeof Jzhcn.Find] === '出生日期结束'
      )?.dateValue,
      outLeaveTime: formList.value.find(
        (item: any) => item.dateLabel && Jzhcn.Find[item.dateLabel.split('.')[1] as keyof typeof Jzhcn.Find] === '离职日期结束'
      )?.dateValue,
      outTime: formList.value.find(
        (item: any) => item.dateLabel && Jzhcn.Find[item.dateLabel.split('.')[1] as keyof typeof Jzhcn.Find] === '进厂日期结束'
      )?.dateValue,
      position: formList.value.find((item: any) => item.selectP && Jzhcn.Find[item.selectP.split('.')[1] as keyof typeof Jzhcn.Find] === '职务')
        ?.selectValue,
      sex: formList.value.find((item: any) => item.selectP && Jzhcn.Find[item.selectP.split('.')[1] as keyof typeof Jzhcn.Find] === '性别')
        ?.selectValue,
      status: cfmFlag(),
      workType: formList.value.find((item: any) => item.selectP && Jzhcn.Find[item.selectP.split('.')[1] as keyof typeof Jzhcn.Find] === '工种')
        ?.selectValue,
      workerId: formList.value.find(
        (item: any) => item.inputPlaceholder && Jzhcn.Find[item.inputPlaceholder.split('.')[1] as keyof typeof Jzhcn.Find] === '请输入工号'
      )?.inputValue,
      pageNum: currentPage.value,
      pageSize: pageSize.value
    })) as any
    const link = document.createElement('a') // 利用a标签自定义下载文件名
    let blob = new Blob([res.data]) // 创建Blob对象，设置文件类型
    link.style.display = 'none'
    //设置连接
    link.href = window.URL.createObjectURL(blob)
    const FileName = decodeURI(res.headers['content-disposition'].split(`filename=`)[1])
    link.download = FileName //自定义文件名字
    document.body.appendChild(link)
    //模拟点击事件
    link.click()
    document.body.removeChild(link)
  }
}
const tableData = ref([])
const isLoading = ref(true)
// 分页器
const currentPage = ref(1)
const pageSize = ref(40)
const total = ref(0)
const handleSizeChange = (val: number) => {
  pageSize.value = val
  getTableList()
}
const handleCurrentChange = (val: number) => {
  currentPage.value = val
  getTableList()
}
let obj = {} as any
const getCurrentDeptName = (treeNode: any, treeData: any) => {
  treeData.forEach((item: any) => {
    if (item.deptNo === treeNode) {
      obj = item
    }
    if (item.childDepartment && item.childDepartment.length > 0) {
      getCurrentDeptName(treeNode, item.childDepartment)
    }
  })
}
let arr = [] as any
const getDeptNameList = (treeData: any) => {
  if (treeData.deptNo) arr.push(treeData.deptName)
  if (treeData.childDepartment && treeData.childDepartment.length > 0) {
    treeData.childDepartment.forEach((item: any) => {
      getDeptNameList(item)
    })
  }
}
const getDeptName = async (treeNode: any) => {
  obj = {}
  getCurrentDeptName(treeNode, treeData.value)
  arr = []
  getDeptNameList(obj)
}
// 获取表数据
const getTableList = debounce(async () => {
  isLoading.value = true
  getDeptName(
    formList.value.find((item: any) => item.treeLabel && Jzhcn.Find[item.treeLabel.split('.')[1] as keyof typeof Jzhcn.Find] === '部门')?.treeValue
  )
  let tableDataList = await service.post<any, any>('/Employee/getPcEmployee', {
    address: formList.value.find(
      (item: any) => item.inputPlaceholder && Jzhcn.Find[item.inputPlaceholder.split('.')[1] as keyof typeof Jzhcn.Find] === '请输入地址'
    )?.inputValue,
    bankCardId: formList.value.find(
      (item: any) => item.inputPlaceholder && Jzhcn.Find[item.inputPlaceholder.split('.')[1] as keyof typeof Jzhcn.Find] === '请输入银行卡号'
    )?.inputValue,
    bankCardName: formList.value.find(
      (item: any) => item.inputPlaceholder && Jzhcn.Find[item.inputPlaceholder.split('.')[1] as keyof typeof Jzhcn.Find] === '请输入开户行'
    )?.inputValue,
    bankCardUser: formList.value.find(
      (item: any) => item.inputPlaceholder && Jzhcn.Find[item.inputPlaceholder.split('.')[1] as keyof typeof Jzhcn.Find] === '请输入开户名'
    )?.inputValue,
    calcType: formList.value.find((item: any) => item.selectP && Jzhcn.Find[item.selectP.split('.')[1] as keyof typeof Jzhcn.Find] === '计件/计时')
      ?.selectValue,
    contract: formList.value.find((item: any) => item.selectP && Jzhcn.Find[item.selectP.split('.')[1] as keyof typeof Jzhcn.Find] === '签订合同')
      ?.selectValue,
    deptName: arr,
    idNo: formList.value.find(
      (item: any) => item.inputPlaceholder && Jzhcn.Find[item.inputPlaceholder.split('.')[1] as keyof typeof Jzhcn.Find] === '请输入身份证号'
    )?.inputValue,
    inBirthday: formList.value.find(
      (item: any) => item.dateLabel && Jzhcn.Find[item.dateLabel.split('.')[1] as keyof typeof Jzhcn.Find] === '出生日期开始'
    )?.dateValue,
    inLeaveTime: formList.value.find(
      (item: any) => item.dateLabel && Jzhcn.Find[item.dateLabel.split('.')[1] as keyof typeof Jzhcn.Find] === '离职日期开始'
    )?.dateValue,
    inTime: formList.value.find(
      (item: any) => item.dateLabel && Jzhcn.Find[item.dateLabel.split('.')[1] as keyof typeof Jzhcn.Find] === '进厂日期开始'
    )?.dateValue,
    name: formList.value.find(
      (item: any) => item.inputPlaceholder && Jzhcn.Find[item.inputPlaceholder.split('.')[1] as keyof typeof Jzhcn.Find] === '请输入姓名'
    )?.inputValue,
    outBirthday: formList.value.find(
      (item: any) => item.dateLabel && Jzhcn.Find[item.dateLabel.split('.')[1] as keyof typeof Jzhcn.Find] === '出生日期结束'
    )?.dateValue,
    outLeaveTime: formList.value.find(
      (item: any) => item.dateLabel && Jzhcn.Find[item.dateLabel.split('.')[1] as keyof typeof Jzhcn.Find] === '离职日期结束'
    )?.dateValue,
    outTime: formList.value.find(
      (item: any) => item.dateLabel && Jzhcn.Find[item.dateLabel.split('.')[1] as keyof typeof Jzhcn.Find] === '进厂日期结束'
    )?.dateValue,
    position: formList.value.find((item: any) => item.selectP && Jzhcn.Find[item.selectP.split('.')[1] as keyof typeof Jzhcn.Find] === '职务')
      ?.selectValue,
    sex: formList.value.find((item: any) => item.selectP && Jzhcn.Find[item.selectP.split('.')[1] as keyof typeof Jzhcn.Find] === '性别')
      ?.selectValue,
    status: cfmFlag(),
    workType: formList.value.find((item: any) => item.selectP && Jzhcn.Find[item.selectP.split('.')[1] as keyof typeof Jzhcn.Find] === '工种')
      ?.selectValue,
    workerId: formList.value.find(
      (item: any) => item.inputPlaceholder && Jzhcn.Find[item.inputPlaceholder.split('.')[1] as keyof typeof Jzhcn.Find] === '请输入工号'
    )?.inputValue,
    pageNum: currentPage.value,
    pageSize: pageSize.value
  })
  isLoading.value = false
  tableData.value = tableDataList.list
  total.value = tableDataList.total
  // currentRow()
}, 500)
onMounted(() => {
  getTableList()
})
watch(
  () =>
    formList.value.map((item: any) => {
      item.selectValue, item.inputValue, item.dateValue, item.checked, item.treeValue
    }),
  () => {
    getTableList()
  }
)

const tableHeader2 = ref([
  {
    change: true,
    label: '姓名',
    prop: 'name'
  },
  {
    change: true,
    label: '性别',
    prop: 'sex'
  },
  {
    width: '200',
    change: true,
    label: '身份证号',
    prop: 'idNo'
  },
  {
    change: true,
    label: '部门名称',
    prop: 'deptName'
  },
  {
    change: true,
    label: '职务',
    prop: 'position'
  },
  {
    change: true,
    label: '工种',
    prop: 'workType'
  },
  {
    change: true,
    label: '变更日期',
    prop: 'sysDate'
  },
  {
    change: true,
    label: '类型',
    prop: 'newCalcType'
  },
  {
    change: true,
    label: '变更后',
    prop: 'change'
  },
  {
    change: true,
    label: '计件/计时',
    prop: 'calcType'
  },
  {
    change: true,
    label: '电话号码',
    prop: 'mobileNo'
  },
  {
    change: true,
    label: '地址',
    prop: 'address'
  },
  {
    change: true,
    label: '进厂日期',
    prop: 'dateIn'
  },
  {
    change: true,
    label: '离职日期',
    prop: 'delDate'
  },
  {
    change: true,
    label: '合同签订',
    prop: 'contract'
  }
])
const changeDialog = ref(false)
const tableData2 = ref([])
const formList2 = ref([
  {
    type: 'tree',
    treeValue: '',
    treeLabel: '部门',
    defaultProps: defaultProps,
    treeData: treeData
  },
  {
    type: 'input',
    inputPlaceholder: '请输入姓名',
    inputValue: ''
  },
  {
    type: 'select',
    selectValue: '',
    selectLabel: '',
    selectP: '类型',
    selectOptions: [
      {
        optionKey: '1',
        optionValue: '职务变更',
        optionLabel: '职务变更'
      },
      {
        optionKey: '2',
        optionValue: '部门变更',
        optionLabel: '部门变更'
      },
      {
        optionKey: '3',
        optionValue: '工种变更',
        optionLabel: '工种变更'
      }
    ]
  },
  {
    type: 'input',
    inputPlaceholder: '请输入身份证号',
    inputValue: ''
  },
  {
    type: 'select',
    selectValue: '',
    selectLabel: '',
    selectP: '职务',
    selectOptions: workOption
  },
  {
    type: 'select',
    selectValue: '',
    selectP: '工种',
    selectOptions: workTypeOption
  },
  {
    type: 'select',
    selectValue: '',
    selectLabel: '',
    selectP: '计件/计时',
    selectOptions: [
      {
        optionKey: '1',
        optionValue: '计件',
        optionLabel: '计件'
      },
      {
        optionKey: '2',
        optionValue: '计时',
        optionLabel: '计时'
      }
    ]
  },
  {
    type: 'select',
    selectValue: '',
    selectLabel: '',
    selectP: '性别',
    selectOptions: [
      {
        optionKey: '1',
        optionValue: '男',
        optionLabel: '男'
      },
      {
        optionKey: '2',
        optionValue: '女',
        optionLabel: '女'
      }
    ]
  },
  {
    type: 'dateSingle',
    dateLabel: '离职日期',
    dateValue: ''
  },
  {
    type: 'dateSingle',
    dateLabel: '变更日期开始',
    dateValue: ''
  },
  {
    type: 'dateSingle',
    dateLabel: '变更日期结束',
    dateValue: ''
  },
  {
    type: 'input',
    inputPlaceholder: '请输入变更后信息',
    inputValue: ''
  },
  {
    type: 'input',
    inputPlaceholder: '请输入地址',
    inputValue: ''
  },
  {
    type: 'button',
    checkboxLabel: '置空',
    bgColor: '#1890FF'
  },
  {
    type: 'button',
    checkboxLabel: '导出'
  }
])
// 表二模块
const findClicked2 = (content: string) => {
  if (content === '置空') {
    formList2.value.forEach((item: any) => {
      item.treeValue = ''
      item.inputValue = ''
      item.selectValue = ''
      item.dateValue = ''
    })
  }
}
const isLoading2 = ref(true)
// 分页器
const currentPage2 = ref(1)
const pageSize2 = ref(40)
const total2 = ref(0)
const handleSizeChange2 = (val: number) => {
  pageSize2.value = val
  getTableList2()
}
const handleCurrentChange2 = (val: number) => {
  currentPage2.value = val
  getTableList2()
}
// 获取表数据
const getTableList2 = debounce(async () => {
  getDeptName(
    formList2.value.find((item: any) => item.treeLabel && Jzhcn.Find[item.treeLabel.split('.')[1] as keyof typeof Jzhcn.Find] === '部门')?.treeValue
  )
  isLoading2.value = true
  let tableDataList = await service.post<any, any>('/Employee/EmployeeChangesList', {
    address: formList2.value.find(
      (item: any) => item.inputPlaceholder && Jzhcn.Find[item.inputPlaceholder.split('.')[1] as keyof typeof Jzhcn.Find] === '请输入地址'
    )?.inputValue,
    calcType: formList2.value.find((item: any) => item.selectP && Jzhcn.Find[item.selectP.split('.')[1] as keyof typeof Jzhcn.Find] === '计件/计时')
      ?.selectValue,
    change: formList2.value.find(
      (item: any) => item.inputPlaceholder && Jzhcn.Find[item.inputPlaceholder.split('.')[1] as keyof typeof Jzhcn.Find] === '请输入变更后信息'
    )?.inputValue,
    deptName: arr,
    idNo: formList2.value.find(
      (item: any) => item.inputPlaceholder && Jzhcn.Find[item.inputPlaceholder.split('.')[1] as keyof typeof Jzhcn.Find] === '请输入身份证号'
    )?.inputValue,
    inLeaveTime: formList2.value.find(
      (item: any) => item.dateLabel && Jzhcn.Find[item.dateLabel.split('.')[1] as keyof typeof Jzhcn.Find] === '离职日期'
    )?.dateValue,
    inTime: formList2.value.find(
      (item: any) => item.dateLabel && Jzhcn.Find[item.dateLabel.split('.')[1] as keyof typeof Jzhcn.Find] === '变更日期开始'
    )?.dateValue,
    name: formList2.value.find(
      (item: any) => item.inputPlaceholder && Jzhcn.Find[item.inputPlaceholder.split('.')[1] as keyof typeof Jzhcn.Find] === '请输入姓名'
    )?.inputValue,
    outLeaveTime: formList2.value.find(
      (item: any) => item.dateLabel && Jzhcn.Find[item.dateLabel.split('.')[1] as keyof typeof Jzhcn.Find] === '离职日期'
    )?.dateValue,
    outTime: formList2.value.find(
      (item: any) => item.dateLabel && Jzhcn.Find[item.dateLabel.split('.')[1] as keyof typeof Jzhcn.Find] === '变更日期结束'
    )?.dateValue,
    position: formList2.value.find((item: any) => item.selectP && Jzhcn.Find[item.selectP.split('.')[1] as keyof typeof Jzhcn.Find] === '职务')
      ?.selectValue,
    sex: formList2.value.find((item: any) => item.selectP && Jzhcn.Find[item.selectP.split('.')[1] as keyof typeof Jzhcn.Find] === '性别')
      ?.selectValue,
    type:
      formList2.value.find((item: any) => item.selectP && Jzhcn.Find[item.selectP.split('.')[1] as keyof typeof Jzhcn.Find] === '类型')
        ?.selectValue === '职务变更'
        ? '1'
        : formList2.value.find((item: any) => item.selectP && Jzhcn.Find[item.selectP.split('.')[1] as keyof typeof Jzhcn.Find] === '类型')
            ?.selectValue === '部门变更'
        ? '2'
        : formList2.value.find((item: any) => item.selectP && Jzhcn.Find[item.selectP.split('.')[1] as keyof typeof Jzhcn.Find] === '类型')
            ?.selectValue === '部门变更'
        ? '3'
        : '',
    workType: formList2.value.find((item: any) => item.selectP && Jzhcn.Find[item.selectP.split('.')[1] as keyof typeof Jzhcn.Find] === '工种')
      ?.selectValue,
    pageNum: currentPage2.value,
    pageSize: pageSize2.value
  })
  isLoading2.value = false
  tableData2.value = tableDataList.list
  total2.value = tableDataList.total
  // currentRow2()
}, 500)
watch(formList2.value, () => {
  getTableList2()
})
</script>

<style lang="less" scoped>
h1 {
  font-size: 16px;
}
</style>
